package dw.fastfile.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @author: wanghao
 * @create: 2022-11-30 17:51
 **/
@Configuration
public class AppConfig {

    @Bean("freeMarkerConfigurer")
    public FreeMarkerConfigurer freeMarkerConfigurer() {
        FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
        configurer.setDefaultEncoding("UTF-8");
        configurer.setTemplateLoaderPath("classpath:/templates/");

        Map<String, Object> variables = new HashMap<>();
        variables.put("xml escape", "fmXmlEscape");
        configurer.setFreemarkerVariables(variables);
        return configurer;
    }

//    @Bean("handleDict")
//    public HandleDict handleDict() {
//        return new HandleDict();
//    }


}
